﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="chi_tiet_donhang.ascx.cs" Inherits="eDream.admin.chi_tiet_donhang" %>
<%@ Register Assembly="DevExpress.Web.v12.2, Version=12.2.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v12.2, Version=12.2.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxPanel" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v12.2, Version=12.2.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxCallbackPanel" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v12.2, Version=12.2.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dx" %>

<div style="margin-top: 20px">
    <dx:ASPxGridView ID="grvDonhang" runat="server" Theme="DevEx" AutoGenerateColumns="False" EnableTheming="True" KeyFieldName="IDd">
        <Columns>
            <dx:GridViewBandColumn Name="donhang" Caption="Thông tin đơn hàng">
                <HeaderStyle Font-Bold="true" Font-Size="15px" />
                <Columns>
                    <dx:GridViewDataTextColumn Caption="STT" Name="colRowID" VisibleIndex="0"
                                Width="20px">
                                <DataItemTemplate>
                                    <dx:ASPxLabel ID="lblRowID" runat="server" Text='<%# Container.ItemIndex + 1 %>'>
                                    </dx:ASPxLabel>
                                </DataItemTemplate>
                      </dx:GridViewDataTextColumn>

                    <dx:GridViewDataTextColumn Caption="Sản phẩm" FieldName="iProName" VisibleIndex="3" Width="170px">
                            <DataItemTemplate>
                                <a href='<%# String.Format("http://msmart.vn/San-pham/{0}/{1}.html", Eval("ProductID"), Utility1.WebUtils.convertToUnSign3(Eval("iProName").ToString())) %>' style="font-weight:bold" ><%#Eval("iProName") %></a>
                            </DataItemTemplate>
                            <CellStyle Wrap="True"></CellStyle>
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="Số lượng" FieldName="Soluong" VisibleIndex="4" Width="80px">
                            <CellStyle HorizontalAlign="Center"></CellStyle>
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="Đơn giá" FieldName="dongia" VisibleIndex="5" Width="100px">
                            <DataItemTemplate>
                                <%# Utility1.Utils.GetMoneyString(double.Parse(Eval("Gia").ToString())) %> vnđ
                            </DataItemTemplate>
                            <CellStyle HorizontalAlign="Center"></CellStyle>
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Name="Thanhtien" Caption="Thành tiền" FieldName="thanhtien" VisibleIndex="6" Width="120px">
                             <DataItemTemplate>
                                <%# Utility1.Utils.GetMoneyString(double.Parse(Eval("tongtien").ToString())) %> vnđ
                            </DataItemTemplate>
                            <CellStyle HorizontalAlign="Center" Wrap="True"></CellStyle>
                            <FooterTemplate>
                                <dx:ASPxLabel ID="lbTong" runat="server" Font-Bold="true" ForeColor="Red" Text=""></dx:ASPxLabel>
                            </FooterTemplate>
                        </dx:GridViewDataTextColumn>
                    <dx:GridViewDataDateColumn Caption="Ngày đặt" FieldName="datePost" VisibleIndex="7" Width="90px">
                        <CellStyle HorizontalAlign="Center"></CellStyle>

                    </dx:GridViewDataDateColumn>
                    <dx:GridViewDataTextColumn Caption="Trạng thái" FieldName="trangthai" VisibleIndex="8" Width="100px">
                    </dx:GridViewDataTextColumn>
                    <dx:GridViewDataTextColumn Caption="Hình thức" FieldName="hinhthuc" VisibleIndex="9" Width="100px">
                    </dx:GridViewDataTextColumn>
                </Columns>
                
            </dx:GridViewBandColumn>
        </Columns>




        <SettingsBehavior AllowSort="false" />
        <Settings ShowFooter="true" />
    </dx:ASPxGridView>

    <br />

    <dx:ASPxGridView ID="grvDiachi" runat="server" Theme="DevEx" AutoGenerateColumns="False" EnableTheming="True" KeyFieldName="IDd" >
        <Columns>
            <dx:GridViewBandColumn Caption="Thông tin chuyển hàng">
                <HeaderStyle Font-Bold="true" Font-Size="15px" />
                <Columns>
   
                    <dx:GridViewDataTextColumn Caption="Họ và tên" FieldName="hovaten" VisibleIndex="1" Width="250px">
                      
                    </dx:GridViewDataTextColumn>
                    <dx:GridViewDataTextColumn Caption="Điện thoai" FieldName="dienthoai" VisibleIndex="2" Width="110px">
                        <CellStyle HorizontalAlign="Center"></CellStyle>
                    </dx:GridViewDataTextColumn>
     
                    <dx:GridViewDataTextColumn Caption="Địa chỉ" FieldName="duong" VisibleIndex="3" Width="450px">
                       <DataItemTemplate>
                           <%#Eval("sonha") %>, <%#Eval("duong") %>, <%#Eval("district") %>, <%#Eval("city") %>
                       </DataItemTemplate>
                    </dx:GridViewDataTextColumn>
                </Columns>

            </dx:GridViewBandColumn>
        </Columns>




        <SettingsBehavior AllowSort="false" />

    </dx:ASPxGridView>
    <br />
    <div style="float:left; margin-right:10px">
        <dx:ASPxButton ID="btnChuyen" runat="server" Text="Chuyển hàng" Theme="DevEx" OnClick="btnChuyen_Click" AutoPostBack="false"></dx:ASPxButton>
    </div>
    <div style="float:left">
        <dx:ASPxButton ID="btnHuy" runat="server" Text="Hủy đơn hàng" Theme="DevEx" OnClick="btnHuy_Click" AutoPostBack="false"></dx:ASPxButton>
    </div>
    <asp:HiddenField ID="hdfId" runat="server" />
</div>
